const { DataTypes } = require('sequelize');

module.exports = function ErrorModel(sequelize, namespace = '') {
	sequelize.define('ErrorModel', {
		id: {
			type: DataTypes.INTEGER,
			allowNull: false,
			autoIncrement: true,
			primaryKey: true
		},
		companyName: {
			type: DataTypes.STRING
		},
		modelId: {
			type: DataTypes.STRING
		},
		fpid: {
			type: DataTypes.STRING
		},
		status: {
			type: DataTypes.INTEGER,
			default: 0
		},
		errorDetail: {
			type: DataTypes.STRING
		},
		mark: {
			type: DataTypes.STRING
		},
		uploadTime: {
			type: DataTypes.DATE
		},
		createdAt: {
			type: DataTypes.DATE
		},
		updatedAt: {
			type: DataTypes.DATE
		},
		deletedAt: {
			type: DataTypes.DATE
		}
	}, {
		tableName: `${namespace}error_model`
	});
};